/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ddsunase_parser;

import java.util.Date;

/**
 *
 * @author samy
 */
public class ResultFieldObj implements Comparable<ResultFieldObj> {

    private String ID;
    private double SimValue;
    private double rank;
    private Date date;
    private double diffTime;
    private double resolveCase;
    private Date resolutionDate;
    
    private Date resolutionAll;
    private double pairsProbability;
    
        private String productId;
    private String componentId;
    private String reportId;

    public String getReportId() {
        return reportId;
    }

    public void setReportId(String reportId) {
        this.reportId = reportId;
    }

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public String getComponentId() {
        return componentId;
    }

    public void setComponentId(String componentId) {
        this.componentId = componentId;
    }

    public Date getResolutionAll() {
        return resolutionAll;
    }

    public void setResolutionAll(Date resolutionAll) {
        this.resolutionAll = resolutionAll;
    }

    public void setPairsProbability(double pairsProbability) {
        this.pairsProbability = pairsProbability;
    }

    public double getPairsProbability() {
        return pairsProbability;
    }

    public Date getResolutionDate() {
        return resolutionDate;
    }

    public void setResolutionDate(Date resolutionDate) {
        this.resolutionDate = resolutionDate;
    }

    public double getResolveCase() {
        return resolveCase;
    }

    public void setResolveCase(double resolveCase) {
        this.resolveCase = resolveCase;
    }
    private double probDup;

    public double getProbDup() {
        return probDup;
    }

    public void setProbDup(double probDup) {
        this.probDup = probDup;
    }

    public double w1;
    public double w2;
    public double w3;

    public double getW3() {
        return w3;
    }

    public void setW3(double w3) {
        this.w3 = w3;
    }

    public double getRank() {
        return rank;
    }

    public void setRank(double rank) {
        this.rank = rank;
    }

    public String getID() {
        return ID;
    }

    public void setID(String ID) {
        this.ID = ID;
    }

    public double getSimValue() {
        return SimValue;
    }

    public void setSimValue(double SimValue) {
        this.SimValue = SimValue;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public double getDiffTime() {
        return diffTime;
    }

    public void setDiffTime(double diffTime) {
        this.diffTime = diffTime;
    }

    public double getW1() {
        return w1;
    }

    public void setW1(double w1) {
        this.w1 = w1;
    }

    public double getW2() {
        return w2;
    }

    public void setW2(double w2) {
        this.w2 = w2;
    }

//        @Override
//    public int compareTo(ResultFieldObj o) {
//
////        if (((o.getSimValue() * o.getW1()) + (((double) o.getDiffTime() * o.getW2())) + o.getW3() * o.getRank()) > (((this.SimValue * w1) + ((double) this.diffTime * w2))) + w3 * this.rank) {
////            return 1;
////        }
////        if (((o.getSimValue() * o.getW1()) + (((double) o.getDiffTime() * o.getW2())) + o.getW3() * o.getRank()) < (((this.SimValue * w1) + ((double) this.diffTime * w2))) + w3 * this.rank) {
////            return -1;
////        } else {
////            return 0;
////        }
//        
//        
////           System.out.println("Am sorting");
//        if(this.rank<=1||o.getRank()<=1)
//        {
//            return 0;
//        }
////        
////       System.out.println("Am sorting");
//        
//        if ((Integer.valueOf(o.getID()))>Integer.valueOf((this.ID) )) {
//            return 1;
//        }
//       else   if (Integer.valueOf((o.getID())) < (Integer.valueOf(this.ID)) ){
//            return -1;
//        } else {
//            return 0;
//        }
//
//        //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
//    }
//    
    
    
    
    @Override
    public int compareTo(ResultFieldObj o) {

//        if (((o.getSimValue() * o.getW1()) + (((double) o.getDiffTime() * o.getW2())) + o.getW3() * o.getRank()) > (((this.SimValue * w1) + ((double) this.diffTime * w2))) + w3 * this.rank) {
//            return 1;
//        }
//        if (((o.getSimValue() * o.getW1()) + (((double) o.getDiffTime() * o.getW2())) + o.getW3() * o.getRank()) < (((this.SimValue * w1) + ((double) this.diffTime * w2))) + w3 * this.rank) {
//            return -1;
//        } else {
//            return 0;
//        }
        if ((o.getProbDup()) > (this.probDup) ) {
            return 1;
        }
       else   if ((o.getProbDup()) < (this.probDup) ){
            return -1;
        } else {
            return 0;
        }

        //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
//
//    public int compareRank(ResultFieldObj o) {
//
//        if (o.getRank() < this.getRank()) {
//            return 1;
//        }
//        if (o.getRank() > this.getRank()) {
//            return -1;
//        } else {
//            return 0;
//        }
//        //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
//    }

}